package c.c.b.b.g;

import android.content.Context;

/* compiled from: ProcessUtils */
public class c {
    public static String a;

    public static boolean a(Context context) {
        String b = b(context);
        boolean z = false;
        if (b != null && b.contains(":")) {
            return false;
        }
        if (b != null && b.equals(context.getPackageName())) {
            z = true;
        }
        return z;
    }

    /* JADX WARNING: Missing block: B:27:0x007d, code skipped:
            if (r0 != null) goto L_0x0076;
     */
    public static java.lang.String b(android.content.Context r5) {
        /*
        r0 = a;
        r1 = android.text.TextUtils.isEmpty(r0);
        if (r1 != 0) goto L_0x0009;
    L_0x0008:
        return r0;
    L_0x0009:
        r0 = android.os.Process.myPid();	 Catch:{ Exception -> 0x0032 }
        r1 = "activity";
        r5 = r5.getSystemService(r1);	 Catch:{ Exception -> 0x0032 }
        r5 = (android.app.ActivityManager) r5;	 Catch:{ Exception -> 0x0032 }
        r5 = r5.getRunningAppProcesses();	 Catch:{ Exception -> 0x0032 }
        r5 = r5.iterator();	 Catch:{ Exception -> 0x0032 }
    L_0x001d:
        r1 = r5.hasNext();	 Catch:{ Exception -> 0x0032 }
        if (r1 == 0) goto L_0x0036;
    L_0x0023:
        r1 = r5.next();	 Catch:{ Exception -> 0x0032 }
        r1 = (android.app.ActivityManager.RunningAppProcessInfo) r1;	 Catch:{ Exception -> 0x0032 }
        r2 = r1.pid;	 Catch:{ Exception -> 0x0032 }
        if (r2 != r0) goto L_0x001d;
    L_0x002d:
        r5 = r1.processName;	 Catch:{ Exception -> 0x0032 }
        a = r5;	 Catch:{ Exception -> 0x0032 }
        return r5;
    L_0x0032:
        r5 = move-exception;
        r5.printStackTrace();
    L_0x0036:
        r5 = 0;
        r0 = new java.io.BufferedReader;	 Catch:{ all -> 0x007c }
        r1 = new java.io.InputStreamReader;	 Catch:{ all -> 0x007c }
        r2 = new java.io.FileInputStream;	 Catch:{ all -> 0x007c }
        r3 = new java.lang.StringBuilder;	 Catch:{ all -> 0x007c }
        r3.<init>();	 Catch:{ all -> 0x007c }
        r4 = "/proc/";
        r3.append(r4);	 Catch:{ all -> 0x007c }
        r4 = android.os.Process.myPid();	 Catch:{ all -> 0x007c }
        r3.append(r4);	 Catch:{ all -> 0x007c }
        r4 = "/cmdline";
        r3.append(r4);	 Catch:{ all -> 0x007c }
        r3 = r3.toString();	 Catch:{ all -> 0x007c }
        r2.<init>(r3);	 Catch:{ all -> 0x007c }
        r3 = "iso-8859-1";
        r1.<init>(r2, r3);	 Catch:{ all -> 0x007c }
        r0.<init>(r1);	 Catch:{ all -> 0x007c }
        r1 = new java.lang.StringBuilder;	 Catch:{ all -> 0x007a }
        r1.<init>();	 Catch:{ all -> 0x007a }
    L_0x0067:
        r2 = r0.read();	 Catch:{ all -> 0x007a }
        if (r2 <= 0) goto L_0x0072;
    L_0x006d:
        r2 = (char) r2;	 Catch:{ all -> 0x007a }
        r1.append(r2);	 Catch:{ all -> 0x007a }
        goto L_0x0067;
    L_0x0072:
        r5 = r1.toString();	 Catch:{ all -> 0x007a }
    L_0x0076:
        r0.close();	 Catch:{ Exception -> 0x0080 }
        goto L_0x0080;
        goto L_0x007d;
    L_0x007c:
        r0 = r5;
    L_0x007d:
        if (r0 == 0) goto L_0x0080;
    L_0x007f:
        goto L_0x0076;
    L_0x0080:
        a = r5;
        return r5;
        */
        throw new UnsupportedOperationException("Method not decompiled: c.c.b.b.g.c.b(android.content.Context):java.lang.String");
    }
}
